import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {join} from 'path'
import vueJsxPlugin from "@vitejs/plugin-vue-jsx";

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        vue(),
        vueJsxPlugin()
    ],
    resolve: {
        alias: {
            '@': join(__dirname, "./src"),
        }
    },
    esbuild: {
        loader: 'jsx',
    },
    define: {
        'process.env': {},
        '__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': false
    },
    server: {
        port: 9001,
        proxy: {
            '/api': {
                target: 'http://localhost:8080',
                timeout: 5000,
                // rewrite: path => path.replace(/^\/api/, ''),
            }
        }
    }
})
